package com.cyzy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cyzy.pojo.ActivateCode;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zxw
 * @create 2025-05-23 下午3:28
 */
@Mapper
public interface ActivateCodeMapper extends BaseMapper<ActivateCode> {
    @Insert("<script>" +
            "INSERT INTO activate_code (activate_code, course_id, user_id, code_status, create_time) " +
            "VALUES " +
            "<foreach collection='list' item='item' separator=','>" +
            "(#{item.activateCode}, #{item.courseId}, #{item.userId}, #{item.codeStatus}, #{item.createTime})" +
            "</foreach>" +
            "</script>")
    void insertBatch(@Param("list") List<ActivateCode> codeList);
}
